package com.zzw.utils;
import java.util.Map;

import org.springframework.data.redis.core.RedisTemplate;

@SuppressWarnings({ "unchecked", "rawtypes" })
public class JredisCli {

    /**
     * 添加MAP
     * @param redisTemplate
     * @param key
     * @param map
     */
	public static void setMap(RedisTemplate redisTemplate, String key,Map<String,String> map){

       redisTemplate.opsForHash().putAll(key,map);
    }

    /**
     * 获取MAP
     * @param redisTemplate
     * @param key
     * @return
     */
    public static Map<String,String> getMap(RedisTemplate redisTemplate,String key){

        return redisTemplate.boundHashOps(key).entries();
    }

}
